﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MeetingDocument.aspx.cs"
    Inherits="Meeting.Web.Admin.MeetingPre.MeetingDocument" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="../../Css/SmartWizard/smart_wizard.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../../Scripts/jquery-1.8.2.min.js"></script>
      <!--ardialog-->
    <script type="text/javascript" src="../../Scripts/artDialog4.1.6/artDialog.js?skin=blue"></script>
    <script type="text/javascript" src="../../Scripts/artDialog4.1.6/plugins/iframeTools.js"></script>
    <link href="../../Css/main.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="../../Scripts/themes/cupertino/easyui.css" />
    <link rel="stylesheet" type="text/css" href="../../Scripts/themes/icon.css" />
    <script type="text/javascript" src="../../Scripts/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="../../Scripts/locale/easyui-lang-zh_CN.js"></script>
    <script src="../../Scripts/datagrid-detailview.js" type="text/javascript"></script>
    <script type="text/javascript" src="../../Scripts/common.js"></script>
    <script src="../../Scripts/Json2.js" type="text/javascript"></script>
    <script type="text/javascript">
        var meetingId = request("Id");
        var CategoryId = request("CategoryId");
        $(function () {
            
            $("#MeetingName").html(unescape(request("Name")));
            InitMeetingDocument();
        });
        function InitMeetingDocument() {
            $("#meetingTopicSelect").datagrid({
                url: 'MeetingOperation.ashx?method=GetSelectTopic&Id=' + meetingId,
                singleSelect: true,
                view: detailview,
                detailFormatter: function (index, row) {
                    return '<div style="padding:2px"><table id="ddvMeetingTopicDoc-' + index + '"></table></div>';
                },
                onExpandRow: function (index, row) {
                    $('#ddvMeetingTopicDoc-' + index).datagrid({
                        url: 'MeetingOperation.ashx?method=GetMeetingTopicDocument&Id=' + row.TopicId,
                        nowrap:false,
                        singleSelect: true,
                        rownumbers: false,
                        loadMsg: '',
                        height: 'auto',
                        columns: [[
                            { field: 'Name', title: '文档名称', width: 385 },
                            { field: 'MeetingId', title: '', hidden: true },
                            { field: 'TopicId', title: '', hidden: true },
                            { field: 'DocumentId', title: '', hidden: true },
                            { field: 'action', title: '操作', formatter: formatDocDel }
                        ]],
                        onResize: function () {
                            $('#meetingTopicSelect').datagrid('fixDetailRowHeight', index);
                        },
                        onLoadSuccess: function () {
                            setTimeout(function () {
                                $('#meetingTopicSelect').datagrid('fixDetailRowHeight', index);
                            }, 0);
                        }
                    });
                    $('#meetingTopicSelect').datagrid('fixDetailRowHeight', index);
                }
            });
        }
        function formatDocDel(val, row) {
            return "<a href='#' class='easyui-linkbutton' onclick=\"RemoveMeetingDocument('" + row.MeetingId + "','" + row.TopicId + "','" + row.DocumentId + "');\"  >移除</a> ";
        }
        function RemoveMeetingDocument(mId, tId, dId) {
            $.messager.confirm("询问", "确定要移除该文档吗？", function (c) {
                if (!c) return;
                var postData = { MeetingId: mId, TopicId: tId, DocumentId: dId };
                $.post("MeetingOperation.ashx?method=DeleteMeetingTopicDocument", postData, function (data) {
                    if (data.success == true) {
                        $("#meetingTopicSelect").datagrid("reload");
                        $.messager.alert("提示", "删除成功");
                    } else {
                        $.messager.alert("提示", data.Message);
                    }
                });
            });
        }
        function AddMeetingTopicDoc(val, row) {
            return "<a href='#' class='easyui-linkbutton' onclick=\"AddMeetingDocument('" + row.MeetingId + "','" + row.TopicId + "');\"  >新增文档</a> ";
        }
        function AddMeetingDocument(meetingId, topicId) {
            var url = 'MeetingFile.aspx?MeetingId=' + meetingId + '&TopicId=' + topicId;
            art.dialog.open(url, {
                id: 'AAA', width: 430, height: 380, lock: true,
                close: function () {
                    $("#meetingTopicSelect").datagrid("reload");

                }
            }, false);
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table class="showView1" cellpadding="0" cellspacing="0" align="center">
            <tr>
                <td class="title">
                    会议名称:
                </td>
                <td class="td_Modify1" style="">
                    <span id="MeetingName"></span>
                </td>
            </tr>
            <tr>
                <td class="title">
                    已选议题:
                </td>
                <td class="td_Modify1" style="">
                    <table id="meetingTopicSelect" style="width: 500px; height: 360px;" singleselect="true"
                       nowrap="false" fitcolumns="true">
                        <thead>
                            <tr>
                                <th data-options="field:'MeetingId',width:80,hidden:true">
                                    编号
                                </th>
                                <th data-options="field:'TopicId',width:80,hidden:true">
                                    编号
                                </th>
                                <th data-options="field:'Title',width:240">
                                    议题标题
                                </th>
                                <th data-options="field:'EmployeeId',width:100,hidden:true">
                                    人员编号
                                </th>
                                <th data-options="field:'EmployeeTitle',width:80,hidden:true">
                                    职务
                                </th>
                                <th data-options="field:'EmployeeName',width:60 ">
                                    主讲人
                                </th>
                                <th data-options="field:'RoleId',width:80,hidden:true">
                                </th>
                                <th data-options="field:'Sort',width:40,editor:'text'">
                                    排序
                                </th>
                               <%-- <th data-options="field:'action',width:80,formatter:AddMeetingTopicDoc">
                                </th>--%>
                            </tr>
                        </thead>
                    </table>
                </td>
            </tr>
           <%-- <tr>
                <td class="title">
                </td>
                <td class="td_Modify1" style="">
                    <a href="#" class="easyui-linkbutton" onclick="SaveMeetingVote();">保存</a>
                </td>
            </tr>--%>
        </table>
    </div>
    </form>
</body>
</html>
